package com.usian.service;

import com.usian.dao.EmpMapper;
import com.usian.dao.ZhiMapper;
import com.usian.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmpService {
    @Autowired
    private EmpMapper empMapper;

    public Role findByName(Role role) {
        String ename = role.getEname();
        String pws = role.getPws();
        return    empMapper.findByName(ename,pws);
    }

    public List<Dto> findEmp() {
        return empMapper.findAll();
    }

    public List<Dept> findDept() {
        return empMapper.findDept();
    }

    public List<Zd> findzhi() {
        return empMapper.findZhi();
    }


    public void deleteEmp(Integer id) {
        empMapper.deleteByPrimaryKey(id);
    }


    public Emp findByid(Integer id) {
        return empMapper.findById(id);
    }

    public void upemp(Emp emp) {
        empMapper.updateByPrimaryKeySelective(emp);
    }

    public void addemp(Emp emp) {
        empMapper.insert(emp);
    }

   /* public List<Dto> findB() {
        return empMapper.findB();
    }*/
}
